function ImageNote(doc, container, width, height, user, date, options) {
  this._doc = doc;
  this._container = container;
  this._width = (width) ? width : '30px';
  this._height = (height) ? height: '30px';
  this._user = user;
  this._date = date;
  this._options = options;
  
  this._exist = (options && options.exist) ? options.exist : false;
  this._note = (options && options.obj) ? options.obj : null;
  
  this._unique = MiscUtils.unique();
  
  this._createElements();
  this._gui = AbsImageNote.gui(this._unique, this._exist);
}

ImageNote.prototype._createElements = function() {
  
  if (this._exist) {
    var div = document.createElement('div');
    div.id = this._unique + '_move_div';
    this._container.appendChild(div);
    
    var divclose = document.createElement('div');
    divclose.style.position = 'absolute';
    divclose.style.left = '102%';
    divclose.style.top = '-10px';
    divclose.style.width = '10px';
    divclose.style.height = '10px';
    divclose.style.cursor = 'pointer';
    divclose.id = this._unique + '_close_div';
    divclose.style.textAlign = 'center';
    divclose.style.verticalAlign = 'middle';
    divclose.appendChild(document.createTextNode('x'));
    div.appendChild(divclose);
    
    var div1 = document.createElement('div');
  //  div1.style.backgroundColor = '#dec';
  //  div1.style.border = 'solid 1px #dec';
//    div1.style.width = '190px';
//    div1.style.height = '65px';
    div1.id = this._unique + '_content_div';
    div1.style.position = 'absolute';
    this._container.appendChild(div1);
  
    div1.style.verticalAlign = 'top';
    var table, tr, td, input;
    table = this._doc.createElement('table');
//  table.style.width = '180px';
//  table.style.height = '65px';
    table.cellPadding = 0;
    table.cellSpacing = 0;
    div1.appendChild(table);
    
    tr = table.insertRow(-1);
    td = tr.insertCell(-1);
    var text = document.createElement('div');
    text.appendChild(document.createTextNode(this._note.text));
    td.appendChild(text);
  } else {
    var div = document.createElement('div');
    div.id = this._unique + '_move_div';
    this._container.appendChild(div);
    
    var div1 = document.createElement('div');
    //div1.style.backgroundColor = '#dec';
    //div1.style.border = 'solid 1px #dec';
    div1.style.width = '190px';
    div1.style.height = '65px';
    div1.id = this._unique + '_content_div';
    div1.style.position = 'absolute';
    this._container.appendChild(div1);
    
    var table, tr, td, input;
    table = this._doc.createElement('table');
    table.style.width = '180px';
    table.style.height = '65px';
    table.cellPadding = 0;
    table.cellSpacing = 0; 
    div1.appendChild(table);
    
    tr = table.insertRow(-1);
    td = tr.insertCell(-1);
    td.colSpan=2;
    td.style.padding = '2px 0 0 2px';
    td.style.verticalAlign = 'top';
    var textarea = document.createElement('textarea');
    textarea.style.width = '180px';
    textarea.style.height = '30px';
    textarea.id = this._unique + '_note_textarea';
    td.appendChild(textarea);
    
    tr = table.insertRow(-1);
    td = tr.insertCell(-1);
    td.style.padding = '0 0 0 2px';
    td.colSpan=2;
    var save = document.createElement('input');
    save.type = 'button';
    save.value = 'Save';
    save.id = this._unique + '_save_button';
    td.appendChild(save);
    var close = document.createElement('input');
    close.type = 'button';
    close.value = 'Close';
    close.id = this._unique + '_close_button';
    td.appendChild(close);
  }
};